<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block data-th-replace="/adminlte/base::base-head"></th:block>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">
<th:block data-th-replace="/adminlte/base::base-navbar"></th:block>
<th:block data-th-replace="/adminlte/base::base-main-sidebar"></th:block>
<div class="content-wrapper">
	<th:block data-th-replace="/adminlte/base::base-content-header"></th:block>
	<section class="content">
		<div class="container-fluid">
	      <div class="card">
	            <div class="card-header">
	            	<div class="row mt-2">
					  <button class="btn btn-app" data-dialog="confirm" data-url="/articles/comments" data-method="delete" data-dialog-t-msg="确定要删除评论吗？" data-check-ids="table tbody input">
		                <i class="fas fa-trash text-blue"></i> 删除评论
		              </button>
		              <div class="w-100"></div>
		              <div class="input-group mx-2 mb-2">
		                  <div class="input-group-prepend">
								<button type="submit" class="btn btn-default" data-get-username="#search-comment" onclick="changeThis(this)">
								<i class="fas fa-search"></i>
								</button>
							</div>
							<input id="search-comment" type="text" name="table_search" class="form-control" placeholder="Search" 
							  autofocus="autofocus" data-get-search="#search-comment" onkeyup="enterThis(this, changeThis)">
		              </div>
		              
	            	</div>
	            </div>
	            <div class="card-body">
	            	<div class="table-responsive">
		              <table id="comment-table" class="table table-bordered table-hover table-striped">
		              	<colgroup>
		              		<col width="50"/>
		              		<col width="200"/>
		              		<col width="200"/>
		              		<col />
		              		<col width="200"/>
		              		<col width="100"/>
		              	</colgroup>
		                <thead>
			                <tr>
			                	<th>
									<input type="checkbox" name="id"/>
								</th>
								<th>用户名</th>
								<th>评论文章</th>
								<th>评论内容</th>
								<th>评论时间</th>
								<th>操作</th>
			                </tr>
		                </thead>
		                <tbody>
		                	<tr data-th-each="comment: ${commentPage.data}">
		                		<td>
									<input type="checkbox" name="ids" th:value="${comment.id}"/>
								</td>
								<td>
									<a th:href="${'/admin/user/'+comment.userId}" data-th-utext="${userUtils.getNickname(comment.userId)}"></a>
								</td>
								<td>
									<a th:href="${'/article/'+comment.articleId}" target="_blank" data-th-utext="${articleUtils.getTitle(comment.articleId)}"></a>
								</td>
								<td data-th-utext="${comment.content}">权限名称</td>
								<td data-th-utext="${comment.createTime}">权限名称</td>
								<td>
									<a title="删除" 
									   data-dialog="confirm"
									   data-method="delete"
									   data-url="/articles/comments/"
									   th:data-path="${comment.id}"
									   data-dialog-t-msg="您确定要删除当前评论吗？">
										<i class="fas fa-trash text-blue" style="margin-left: 10px;"></i>
									</a>
								</td>
		                	</tr>
		                </tbody>
		              </table>
	            	</div>
	            	<th:block data-th-replace="/adminlte/base::pageNav(${commentPage},'个评论')"></th:block>
	            </div>
	     	</div>
		</div>
	</section>
</div>
<th:block data-th-replace="/adminlte/base::base-footer"></th:block>
<th:block data-th-replace="/adminlte/base::base-control-sidebar"></th:block>
</div>
<script src="/kaibes/js/table-check.js"></script>
</body>
</html>